'use strict';

const BaseController = require('./base');
const { Op } = require('sequelize');

class OfficeBuildingTemplateController extends BaseController {
    constructor(ctx) {
        super(ctx, 'officeBuildingTemplate');
    }

    getListQuery(query) {
        const where = {};
        for (const queryKey in query) {
            if (query[queryKey]) {
                if (queryKey.includes('_id')) {
                    where[queryKey] = query[queryKey];
                } else {
                    where[queryKey] = {
                        [Op.like]: `%${query[queryKey]}%`,
                    }
                }
            }
        }
        return where;
    }
}

module.exports = OfficeBuildingTemplateController;
